package week07.MidEx;



import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

public class PlaneFactory {
    private static Properties prop = new Properties();

    static {
        try {
            prop.load(new FileInputStream("src/week07/MidEx/pl.properties"));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static Plane createPlane() {
        Plane plane = null;
        try {
            plane = (Plane) Class.forName(prop.getProperty("plane")).newInstance();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return plane;
    }
}
